home *** CD-ROM | disk | FTP | other *** search
/ CGI How-To / CGI HOW-TO.iso / chap5 / 5_3 / input_pl / input.txt < prev    next >
Encoding:
Text File  |  1996-06-15  |  837 b   |  53 lines

  1. #!/usr/bin/perl
  2.  
  3. require "parsehtm.pl";
  4.  
  5.  
  6. sub inputHandler
  7. {
  8.     local($tagString,$argString,$endString,%tagDict) 
  9.     = @_;
  10.  
  11.     local($retVal,$type);
  12.  
  13.     $type = $tagDict{"TYPE"};
  14.  
  15.     if($type =~ /text/i)
  16.     {
  17.         $retVal  = $tagString." :: text field";
  18.     }
  19.     elsif($type =~ /password/i)
  20.     {
  21.         $retVal  = $tagString." :: password field";
  22.     }
  23.     elsif($type =~ /checkbox/i)
  24.     {
  25.         $retVal  = $tagString." :: checkbox";
  26.     }
  27.     elsif($type =~ /radio/i)
  28.     {
  29.         $retVal  = $tagString." :: radio";
  30.     }
  31.     elsif($type =~ /submit/i)
  32.     {
  33.         $retVal  = $tagString." :: submit";
  34.     }
  35.     elsif($type =~ /hidden/i)
  36.     {
  37.         $retVal  = $tagString." :: hidden field";
  38.     }
  39.  
  40.     return $retVal
  41. }
  42.  
  43. $handlerDict{"INPUT"} = "inputHandler";
  44.  
  45. $output = &parseHtml("inp_pl.htm");
  46.  
  47. print "Content-type: text/html\n\n";
  48. print $output;
  49.  
  50. 1;
  51.  
  52.  
  53.